/*
 * Copyright (c) 2024. Shanghai HEADING information Engineering Co., Ltd. All rights reserved.
 */
package com.lovely602.design.study.proxy.jdk;

import java.lang.reflect.Proxy;

/**
 * @author lizhixing
 */
public class JdkProxyTest {

  public static void main(String[] args) {

    MyService service = new MyServiceImpl();
    MyService proxyInstance = (MyService) Proxy.newProxyInstance(MyService.class.getClassLoader(), new Class[] { MyService.class }, new JdkInvocationHandler(service));
    proxyInstance.doSomething();

  }
}
